import storage from 'good-storage'

const TOKEN = '__token__'
const ISJIA = '__isjia__'

export const loadToken = () => {
  return storage.get(TOKEN, '')
}

export const saveToken = val => {
  storage.set(TOKEN, val)
  return val
}

export const removeToken = () => {
  storage.remove(TOKEN)
}

export const loadIsJia = () => {
  return storage.get(ISJIA, '')
}

export const saveIsJia = val => {
  storage.set(ISJIA, val)
  return val
}

export const removeIsJia = () => {
  storage.remove(ISJIA)
}

// 清空所有storage
export const clear = () => {
  storage.clear()
}